import { createRequest } from '/@/api/service';
const module = 'ib/base/v1/MessageRecordApi/';

/**
 * @function 查询（我的消息）
 * @param data
 * @param header
 * @returns {Promise}
 */
function MESSAGE_RECORD_QUERY(
  data: MessageRecordApi.MessageRecordQueryReq,
  header: object = {},
): Promise<MessageRecordApi.MessageRecordQueryResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}messageRecordQuery`,
    data,
    header,
    'POST',
  );
}

/**
 * 消息详情信息
 * @param data id
 * @param header 空
 * @returns 消息详情实体
 */
function MESSAGE_RECORD_DETAIL(
  data: MessageRecordApi.MessageRecordDetailReq,
  header: object = {},
): Promise<MessageRecordApi.MessageRecordDetailResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}messageRecordDetail`,
    data,
    header,
    'POST',
  );
}

/**
 * 设置已读未读
 */
function MESSAGE_RECORD_READ(
  data: MessageRecordApi.MessageRecordReadReq,
  header: object = {},
): Promise<MessageRecordApi.MessageRecordReadResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}messageRecordRead`,
    data,
    header,
    'POST',
  );
}
export { MESSAGE_RECORD_QUERY, MESSAGE_RECORD_DETAIL, MESSAGE_RECORD_READ };
